package sv.gob.mh.dgii.dao.rc;

import java.math.BigInteger;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
import sv.gob.mh.dgii.dao.hibernate.HibernateDaoImpl;
import sv.gob.mh.dgii.model.RcActEco;

@Repository
public class RcActEcoDaoImpl extends HibernateDaoImpl implements RcActEcoDao {

    public final String _NIT = "rcRuc.nit";
    public final String _FFIN = "ffactEco";
    public final String _ORDEN = "orden";

    public RcActEcoDaoImpl() {
        super(RcActEco.class); 
	} 
    
    
    @Override
    public Long obtenerSiguienteLlave(){
        Query query = getSessionFactory().getCurrentSession().createSQLQuery( "select SEQ_RC_ACT_ECO.nextval from dual" );
        Long key = ((BigInteger) query.uniqueResult()).longValue();
        return key;
    }
}